home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-02-09 | 6.6 KB | 359 lines |
- Amos To Front
- 'Erase 2
- 'Load "DH0:AMOS/Role/ABK/Walls.ABK"
- Change Mouse 2
-
- Timer=0
- _DIM_X=10 : _DIM_Y=10
- Global _DIM_X,_DIM_Y
-
- Dim _MAP(_DIM_X,_DIM_Y)
- Global _MAP()
- For Y=0 To _DIM_Y
- For X=0 To _DIM_X
- Read _MAP(X,Y)
- Next
- Next
-
- Data 1,1,1,1,1,1,1,1,1,1,1
- Data 1,0,1,0,1,0,1,0,1,0,1
- Data 1,0,1,0,1,0,1,0,1,0,1
- Data 1,0,0,0,0,0,0,0,1,0,1
- Data 1,0,0,0,0,0,0,0,1,0,1
- Data 1,0,1,1,1,0,0,0,0,0,1
- Data 1,0,1,1,1,0,1,0,0,0,1
- Data 1,0,1,0,1,0,1,0,0,0,1
- Data 1,0,1,1,1,0,1,0,0,0,1
- Data 1,0,1,1,1,0,1,0,0,0,1
- Data 1,1,1,1,1,1,1,1,1,1,1
-
- Screen Open 0,320,170,32,Lowres
- 'Load Iff "DH0:AMOS/role/pic/main.iff",0
- Unpack 11 To 0
- Get Icon Palette : Colour 0,0
- Double Buffer
- Autoback 0
- Update Off
-
-
- Resource Bank 16
- Resource Screen Open 1,320,86,0
- 'Load Iff "Dh0:AMOS/role/PIC/panel.iff",1
- Unpack 12 To 1
- Screen Display 1,,220,,
- A$=A$+"BU 1,208,22,24,20,0,0,1;[UN 0,0,BP1+;][BR0;]"
- A$=A$+"BU 2,232,22,24,20,0,0,1;[UN 0,0,BP5+;][BR0;]"
- A$=A$+"BU 3,256,22,24,20,0,0,1;[UN 0,0,BP3+;][BR0;]"
- A$=A$+"BU 4,208,42,24,20,0,0,1;[UN 0,0,BP7+;][BR0;]"
- A$=A$+"BU 5,232,42,24,20,0,0,1;[UN 0,0,BP9+;][BR0;]"
- A$=A$+"BU 6,256,42,24,20,0,0,1;[UN 0,0,BP11+;][BR0;]"
- A$=A$+"EX;"
- Dialog Open 1,A$
- X=Dialog Run(1)
-
-
-
-
-
-
-
- Make Icon Mask
-
- Global PP
- Screen 0
-
- _LOC_X=1 : _LOC_Y=1
- Global _LOC_X,_LOC_Y
- Global KIER
-
- _DRAW_WALLS[_LOC_X,_LOC_Y]
- _COMPASS
- Do
-
-
- Screen Swap : Wait Vbl
- Do
- K$=Inkey$ : SC=Scancode : D=Dialog(1)
- '
- If(SC=76 or D=2) and _LOC_Y-1>0 and _MAP(_LOC_X,_LOC_Y-1)=0
- Dec _LOC_Y : Exit
- Else If SC=76 or D=2
- _SOUND[1]
- End If
- If(SC=77 or D=5) and _LOC_Y+1<_DIM_Y and _MAP(_LOC_X,_LOC_Y+1)=0
- Inc _LOC_Y : Exit
- Else If SC=77 or D=5
- _SOUND[1]
- End If
- If(SC=78 or D=6) and _LOC_X+1<_DIM_X and _MAP(_LOC_X+1,_LOC_Y)=0
- Inc _LOC_X : Exit
- Else If SC=78 or D=6
- _SOUND[1]
- End If
- If(SC=79 or D=4) and _LOC_X-1>0 and _MAP(_LOC_X-1,_LOC_Y)=0
- Dec _LOC_X : Exit
- Else If SC=79 or D=4
- _SOUND[1]
- End If
- '
- If SC=95 or D=3 : _ROTATE_RIGHT : _COMPASS : End If
- If SC=70 or D=1 : _ROTATE_LEFT : _COMPASS : End If
- '
- If SC=80 : Screen 0 : Save Iff "trash:Pic"+Str$(PP),1 : Inc PP : End If
-
- If Timer>6000 : Stop : End If
- Loop
-
- Proc _DRAW_WALLS[_LOC_X,_LOC_Y]
- Loop
-
-
-
- Procedure _DRAW_WALLS[X,Y]
- '
- NB=14
-
- If KIER mod 2=0
- If X mod 2=0 : OFF_1=NB : OFF_2=0 : Else OFF_1=0 : OFF_2=NB : End If
- If Y mod 2=0 : OFF_3=NB : OFF_4=0 : Else OFF_3=0 : OFF_4=NB : End If
- No Icon Mask 13
- Paste Icon 14,14,13
- Else
- If X mod 2=0 : OFF_1=0 : OFF_2=NB : Else OFF_1=NB : OFF_2=0 : End If
- If Y mod 2=0 : OFF_3=0 : OFF_4=NB : Else OFF_3=NB : OFF_4=0 : End If
- No Icon Mask 14
- Paste Icon 14,14,14
- End If
- '
-
- ' If(X+Y) mod 2=0
- '
- ' Else
-
- ' End If
-
- '
- ' 1
- '
- If X>1 and Y>3
- If _MAP(X-2,Y-4)=1
- Paste Icon 14,43,2+OFF_1
- End If
- End If
- '
- ' 2
- '
- If X>0 and Y>3
- If _MAP(X-1,Y-4)=1
- Paste Icon 35,43,1+OFF_2
- End If
- End If
- '
- ' 3
- '
- If Y>3
- If _MAP(X,Y-4)=1
- Paste Icon 80,43,1+OFF_1
- End If
- End If
- '
- ' 4
- '
- If X<_DIM_X and Y>3
- If _MAP(X+1,Y-4)=1
- Paste Icon 125,43,1+OFF_2
- End If
- End If
- '
- ' 5
- '
- If X<_DIM_X-1 and Y>3
- If _MAP(X+2,Y-4)=1
- Paste Icon 170,43,2+OFF_1
- End If
- End If
- '
- ' 6
- '
- If X>1 and Y>2
- If _MAP(X-2,Y-3)=1
- Paste Icon 4,40,Hrev(7+OFF_3)
- End If
- End If
- '
- ' 7
- '
- If X>0 and Y>2
- If _MAP(X-1,Y-3)=1
- Paste Icon 14,40,3+OFF_2
- Paste Icon 65,40,Hrev(6+OFF_3)
- End If
- End If
- '
- ' 8
- '
- If X<_DIM_X-2 and Y>2
- If _MAP(X+2,Y-3)=1
- Paste Icon 170,40,7+OFF_3
- End If
- End If
- '
- ' 9
- '
- If X<_DIM_X and Y>2
- If _MAP(X+1,Y-3)=1
- Paste Icon 132,40,3+OFF_2
- Paste Icon 125,40,6+OFF_3
- End If
- End If
- '
- ' 10
- '
- If Y>2
- If _MAP(X,Y-3)=1
- Paste Icon 73,40,3+OFF_1
- End If
- End If
- '
- ' 11
- '
- If X>0 and Y>1
- If _MAP(X-1,Y-2)=1
- Paste Icon 14,33,5+OFF_2
- Paste Icon 42,33,Hrev(8+OFF_4)
- End If
- End If
- '
- ' 12
- '
- If X<_DIM_X and Y>1
- If _MAP(X+1,Y-2)=1
- Paste Icon 148,33,5+OFF_2
- Paste Icon 132,33,8+OFF_4
- End If
- End If
- '
- ' 13
- '
- If Y>1
- If _MAP(X,Y-2)=1
- Paste Icon 57,33,4+OFF_1
- End If
- End If
- '
- ' 14
- '
- If X>0 and Y>0
- If _MAP(X-1,Y-1)=1
- Paste Icon 26,20,Hrev(9+OFF_3)
- If _MAP(X-1,Y)=0 : Paste Icon 14,20,11+OFF_2 : End If
- If _MAP(X-1,Y)=1 : Paste Icon 13,14,Hrev(10+OFF_4) : End If
- End If
- End If
- '
- ' 15
- '
- If X<_DIM_X and Y>0
- If _MAP(X+1,Y-1)=1
- Paste Icon 148,20,9+OFF_3
- If _MAP(X+1,Y)=0 : Paste Icon 177,20,11+OFF_2 : End If
- If _MAP(X+1,Y)=1 : Paste Icon 177,14,10+OFF_4 : End If
- End If
- End If
- '
- ' 16
- '
- If _MAP(X,Y-1)=1 : Paste Icon 28,20,12+OFF_1 : End If
- '
- ' 17
- '
- If _MAP(X-1,Y)=1 : Paste Icon 13,14,Hrev(10+OFF_4) : End If
- '
- ' 18
- '
- If _MAP(X+1,Y)=1 : Paste Icon 177,14,10+OFF_4 : End If
- '
- '
- End Proc
- Procedure _ROTATE_RIGHT
- Dim _NOW(10,10)
- '
- '
- '
- For X=0 To 10
- For Y=10 To 0 Step -1
- _NOW(X,Y)=_MAP(10-Y,X)
- Next Y
- Next X
- '
- For X=0 To 10
- For Y=0 To 10
- _MAP(X,Y)=_NOW(X,Y)
- Next Y
- Next X
- '
- '
- '
- Add KIER,1,0 To 3
-
- N_LOC_X=_LOC_Y
- N_LOC_Y=10-_LOC_X
-
- _LOC_X=N_LOC_X
- _LOC_Y=N_LOC_Y
-
- Proc _DRAW_WALLS[_LOC_X,_LOC_Y]
- Screen Swap : Wait Vbl
- End Proc
- Procedure _ROTATE_LEFT
-
- Dim _NOW(10,10)
-
-
-
- For X=0 To 10
- For Y=10 To 0 Step -1
- _NOW(10-Y,X)=_MAP(X,Y)
- Next Y
- Next X
-
- For X=0 To 10
- For Y=0 To 10
- _MAP(X,Y)=_NOW(X,Y)
- Next Y
- Next X
-
-
-
- Add KIER,-1,0 To 3
-
- N_LOC_X=10-_LOC_Y
- N_LOC_Y=_LOC_X
-
- _LOC_X=N_LOC_X
- _LOC_Y=N_LOC_Y
-
- Proc _DRAW_WALLS[_LOC_X,_LOC_Y]
- Screen Swap : Wait Vbl
- End Proc
-
- Procedure _COMPASS
-
- Screen 1
- Gr Writing 1 : Ink 0
- If KIER=0 : T1$="W" : T2$="N" : T3$="E" : End If
- If KIER=1 : T1$="N" : T2$="E" : T3$="S" : End If
- If KIER=2 : T1$="E" : T2$="S" : T3$="W" : End If
- If KIER=3 : T1$="S" : T2$="W" : T3$="N" : End If
-
- Text 27,18,T1$
- Text 47,18,T2$
- Text 67,18,T3$
- Screen 0
- End Proc
-
- Procedure _SOUND[CH]
- Wave 1 To %1010
- Bell 12
-
- End Proc